package com.yuanfengPlus.basicInfoManage.AddressLibrary.dao;

import com.yuanfengPlus.basicInfoManage.AddressLibrary.model.AddressLibrary;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
@Mapper
public interface AddressLibraryDao {

    // 查询并加锁的查询方法，避免死锁
    @Select("SELECT * FROM address_library WHERE address_lib_id = #{addressLibId} FOR UPDATE")
    AddressLibrary selectForUpdate(Long id);

    // 更新地址库信息（仅示例，具体方法根据需要调整）
     int updateAddressLibrary(AddressLibrary addressLibrary);
     //新增地址库信息
     int insertAddress(AddressLibrary addressLibrary);
     //
    List<AddressLibrary> queryAddressLibrary(AddressLibrary addressLibrary, Integer pageNum, Integer pageSize);
    List<AddressLibrary> queryAddressLibrary(AddressLibrary addressLibrary);
}
